import * as Blockly from 'blockly/core';
import * as Mixly from 'mixly';
import './language/loader';

import {
    PythonVariablesBlocks,
    PythonControlBlocks,
    PythonMathBlocks,
    PythonTextBlocks,
    PythonListsBlocks,
    PythonDictsBlocks,
    PythonLogicBlocks,
    PythonStorageBlocks,
    PythonProceduresBlocks,
    PythonTupleBlocks,
    PythonSetBlocks,
    PythonHtmlBlocks,
    PythonUtilityBlocks,
    PythonVariablesGenerators,
    PythonControlGenerators,
    PythonMathGenerators,
    PythonTextGenerators,
    PythonListsGenerators,
    PythonDictsGenerators,
    PythonLogicGenerators,
    PythonStorageGenerators,
    PythonProceduresGenerators,
    PythonTupleGenerators,
    PythonSetGenerators,
    PythonHtmlGenerators,
    PythonUtilityGenerators,
    Procedures,
    Variables,
    Python
} from '@mixly/python';

import {
    MicroPythonActuatorExternBlocks,
    MicroPythonBlynkBlocks,
    MicroPythonDisplayExternBlocks,
    MicroPythonSensorExternBlocks,
    MicroPythonActuatorExternGenerators,
    MicroPythonBlynkGenerators,
    MicroPythonDisplayExternGenerators,
    MicroPythonSensorExternGenerators} from '@mixly/micropython';

import {
    MicroPythonK210AIBitPins,
    MicroPythonK210AIBitActuatorBlocks,
    MicroPythonK210AIBitAIBlocks,
    MicroPythonK210AIBitAVBlocks,
    MicroPythonK210AIBitCameraBlocks,
    MicroPythonK210AIBitCommunicateBlocks,
    MicroPythonK210AIBitDisplayBlocks,
    MicroPythonK210AIBitFactoryBlocks,
    MicroPythonK210AIBitHearBlocks,
    MicroPythonK210AIBitImageBlocks,
    MicroPythonK210AIBitInoutBlocks,
    MicroPythonK210AIBitIotBlocks,
    MicroPythonK210AIBitMathBlocks,
    MicroPythonK210AIBitNesBlocks,
    MicroPythonK210AIBitNetworkBlocks,
    MicroPythonK210AIBitPinsBlocks,
    MicroPythonK210AIBitSensorBlocks,
    MicroPythonK210AIBitSerialBlocks,
    MicroPythonK210AIBitSystemBlocks,
    MicroPythonK210AIBitUavBlocks,
    MicroPythonK210AIBitUpdataBlocks,
    MicroPythonK210AIBitActuatorGenerators,
    MicroPythonK210AIBitAIGenerators,
    MicroPythonK210AIBitAVGenerators,
    MicroPythonK210AIBitCameraGenerators,
    MicroPythonK210AIBitCommunicateGenerators,
    MicroPythonK210AIBitDisplayGenerators,
    MicroPythonK210AIBitFactoryGenerators,
    MicroPythonK210AIBitHearGenerators,
    MicroPythonK210AIBitImageGenerators,
    MicroPythonK210AIBitInoutGenerators,
    MicroPythonK210AIBitIotGenerators,
    MicroPythonK210AIBitMathGenerators,
    MicroPythonK210AIBitNesGenerators,
    MicroPythonK210AIBitNetworkGenerators,
    MicroPythonK210AIBitPinsGenerators,
    MicroPythonK210AIBitSensorGenerators,
    MicroPythonK210AIBitSerialGenerators,
    MicroPythonK210AIBitSystemGenerators,
    MicroPythonK210AIBitUavGenerators,
    MicroPythonK210AIBitUpdataGenerators
} from './export';

import './css/color.css';

Object.assign(Blockly.Variables, Variables);
Object.assign(Blockly.Procedures, Procedures);
Blockly.Python = Python;
Blockly.generator = Python;

Mixly.Profile = Mixly.Profile ?? {};
Mixly.Profile.default = {};
Object.assign(Mixly.Profile, MicroPythonK210AIBitPins);
Object.assign(Mixly.Profile.default, MicroPythonK210AIBitPins['AIBIT-AIOT (爱乐板)']);

Object.assign(
    Blockly.Blocks,
    PythonVariablesBlocks,
    PythonControlBlocks,
    PythonMathBlocks,
    PythonTextBlocks,
    PythonListsBlocks,
    PythonDictsBlocks,
    PythonLogicBlocks,
    PythonStorageBlocks,
    PythonProceduresBlocks,
    PythonTupleBlocks,
    PythonSetBlocks,
    PythonHtmlBlocks,
    PythonUtilityBlocks,
    MicroPythonSensorExternBlocks,
    MicroPythonActuatorExternBlocks,
    MicroPythonDisplayExternBlocks,
    MicroPythonBlynkBlocks,
    MicroPythonK210AIBitActuatorBlocks,
    MicroPythonK210AIBitAIBlocks,
    MicroPythonK210AIBitAVBlocks,
    MicroPythonK210AIBitCameraBlocks,
    MicroPythonK210AIBitCommunicateBlocks,
    MicroPythonK210AIBitDisplayBlocks,
    MicroPythonK210AIBitFactoryBlocks,
    MicroPythonK210AIBitHearBlocks,
    MicroPythonK210AIBitImageBlocks,
    MicroPythonK210AIBitInoutBlocks,
    MicroPythonK210AIBitIotBlocks,
    MicroPythonK210AIBitMathBlocks,
    MicroPythonK210AIBitNesBlocks,
    MicroPythonK210AIBitNetworkBlocks,
    MicroPythonK210AIBitPinsBlocks,
    MicroPythonK210AIBitSensorBlocks,
    MicroPythonK210AIBitSerialBlocks,
    MicroPythonK210AIBitSystemBlocks,
    MicroPythonK210AIBitUavBlocks,
    MicroPythonK210AIBitUpdataBlocks
);

Object.assign(
    Blockly.Python.forBlock,
    PythonVariablesGenerators,
    PythonControlGenerators,
    PythonMathGenerators,
    PythonTextGenerators,
    PythonListsGenerators,
    PythonDictsGenerators,
    PythonLogicGenerators,
    PythonStorageGenerators,
    PythonProceduresGenerators,
    PythonTupleGenerators,
    PythonSetGenerators,
    PythonHtmlGenerators,
    PythonUtilityGenerators,
    MicroPythonSensorExternGenerators,
    MicroPythonActuatorExternGenerators,
    MicroPythonDisplayExternGenerators,
    MicroPythonBlynkGenerators,
    MicroPythonK210AIBitActuatorGenerators,
    MicroPythonK210AIBitAIGenerators,
    MicroPythonK210AIBitAVGenerators,
    MicroPythonK210AIBitCameraGenerators,
    MicroPythonK210AIBitCommunicateGenerators,
    MicroPythonK210AIBitDisplayGenerators,
    MicroPythonK210AIBitFactoryGenerators,
    MicroPythonK210AIBitHearGenerators,
    MicroPythonK210AIBitImageGenerators,
    MicroPythonK210AIBitInoutGenerators,
    MicroPythonK210AIBitIotGenerators,
    MicroPythonK210AIBitMathGenerators,
    MicroPythonK210AIBitNesGenerators,
    MicroPythonK210AIBitNetworkGenerators,
    MicroPythonK210AIBitPinsGenerators,
    MicroPythonK210AIBitSensorGenerators,
    MicroPythonK210AIBitSerialGenerators,
    MicroPythonK210AIBitSystemGenerators,
    MicroPythonK210AIBitUavGenerators,
    MicroPythonK210AIBitUpdataGenerators
);